from django.db import models
from utils.models import CoreModel, table_prefix


class Notice(CoreModel):
    title = models.CharField(max_length=100)
    content = models.TextField()
    is_stress = models.BooleanField(default=False)
    read_ids = models.TextField(default='[]')
    sort_id = models.IntegerField(default=0, db_index=True)

    class Meta:
        db_table = 'notices'
        verbose_name = '系统公告表'
        ordering = ('-sort_id',)


class Navigation(CoreModel):
    title = models.CharField(max_length=64)
    desc = models.CharField(max_length=128)
    logo = models.TextField()
    links = models.TextField()
    sort_id = models.IntegerField(default=0, db_index=True)

    class Meta:
        db_table = table_prefix + 'navigations'
        verbose_name = '便捷导航'
        ordering = ('-sort_id',)
